package threading;

public class ThreadDemo10 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(()->{
            while(true){
                //为了防止hello t 把线程状态冲掉
                //System.out.println("hello t");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }

        });

        //启动之前获取线程状态 NEW
        System.out.println(t.getState());

        t.start();

        Thread.sleep(2000);
        System.out.println(t.getState( ));
    }
}
